$(function(){
	$("#reg").click(function(){
	var username=$("#username").val();
	var password=$("#password").val();
	var erpassword=$("#erpassword").val();
	var age=$("#age").val();
	var phone=$("#phone").val();
	var nickname=$("#nickname").val();
	$.post("/user/register",{
		username:username,
		password:password,
		age:age,
		phone:phone,
		nickname:nickname},function(data){
			if(data.status==0)
            {
                window.location.href="/user/login"
            }
            else
            {
                alert(data.msg);
            }
		},"json");
	});
});